<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加城市列表</title>
    <script type="text/javascript" src="js/jquery-3.3.1.js"></script>
</head>
<body>
<ol id="city">
    <li>广州</li>
    <li>上海</li>
    <li>北京</li>
</ol>
城市名:<input type="text" id="t1" placeholder="请输入城市名">
<input type="button" id="b1" value="添加城市列表">
<script type="text/javascript">
    $("#city").on("click","li",function () {
        alert($(this).text());
    });
    $("#b1").click(function () {
        var val = $("#t1").val();
        var li = $("<li>" + val + "</li>");
        $("#city").append(li);
        $("#t1").val("");
    });
</script>
</body>
</html>